<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
		<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="../layer/layer.js"></script>
		<link rel="stylesheet" type="text/css" href="../css/common/master.css" />
		<link rel="stylesheet" type="text/css" href="../css/jwgk/jwgk.css" />
		<link rel="stylesheet" type="text/css" href="../css/common/dropload.css">
	</head>

	<body>
		<header class="text-center bg-blue">
			<a href="javascript:void(0);" class="pull-left" onClick="javascript:history.back()"></a>
			<span>检务队伍管理</span>
		</header>
		<article class="list-article">
			<div class="article box-shadow">
				<span></span>
				<input name="" class="search width-100" type="text" placeholder="搜索名称、关键词">
				<a href="#" class="text-center pull-right">搜索</a>
			</div>
		</article>
		<div class="content">
			<ul class="padding list">
				<!--<li class="padding">
					<h3 class="text-auto padding-bottom padding-top"><a href="listdetails.html" class="blue">检查新产品“四观”评说</a></h3>
					<div class="clear">
						<div class="pull-left">作者：<span>张三</span></div>
						<div class="pull-right"></div>
					</div>
					<div class="list-box text-auto padding-top padding-bottom text-muted">检查新产品</div>
					<div class="clear">
						<div class="pull-left">2018-7-18</div>
						<a class="pull-right text-muted" href="listdetails.html">查看详情</a>
					</div>
				</li>-->
			</ul>
		</div>
	</body>
		<!--<script src="js/zepto.min.js"></script>-->
		<!--<script src="js/dropload.min.js"></script>-->
		<!--<script type="text/javascript" src="../js/jwgk/jwgk.js"></script>-->
	<script>
		$(function() {
			query('01'); //第一次加载
		});
		function query(type) {
			//console.log(type);
			$.ajax({
				url: "http://192.168.1.113:8080/pkzswm/queryAnnouncementList.action",
				data: {
					pageNo: $("#pageNo").val()
				},
				cache: false,
				success: function(data) {
					loading = true;
					var data = data.AnnouncementList;
					if(data == null) {

						$("#pageNo").val(parseInt($("#pageNo").val()) - 1);
					} else {
						var content = "";
						if(type == "00") {
							if(data.length == 0) {
								$("#pageNo").val(parseInt($("#pageNo").val()) - 1);
								return "";
							}
							for(var i = 0; i < data.length; i++) {
								content = content +
									'<tr>' +
									'<td><div>' + data[i].title + '</div><div>' + data[i].createTime + '</div></td>' +
									'<td>¥' + data[i].content + '</td>' +
									'</tr>';
							}
							console.log("暂无数据");
							$("#wrapper").append(content);
						} else {
							for(var i = 0; i < data.length; i++) {
								content += '<li class="padding">'
								content += '	<h3 class="text-auto padding-bottom padding-top"><a href="listdetails.html" class="blue">' + data[i].createTime + '</a></h3>'
								content += '	<div class="clear">'
								content += '		<div class="pull-left">作者：<span>张三</span></div>'
								content += '		<div class="pull-right"></div>'
								content += '	</div>'
								content += '	<div class="list-box text-auto padding-top padding-bottom text-muted">检查新产品</div>'
								content += '	<div class="clear">'
								content += '		<div class="pull-left">2018-7-18</div>'
								content += '		<a class="pull-right text-muted" href="listdetails.html">查看详情</a>'
								content += '	</div>'
								content += '</li>'
//								content = content +
//									'<tr>' +
//									'<td><div>' + data[i].title + '</div><div>' + data[i].createTime + '</div></td>' +
//									'<td>¥' + data[i].content + '</td>' +
//									'</tr>';
							}
							$("#wrapper").html(content);
						}
					}
				},
				error: function() {
					loading = true;
					$("#pageNo").val(parseInt($("#pageNo").val()) - 1);
					_alert("查询数据出错啦，请刷新再试");
				}
			});
		}
		var loading = false;
		Zepto(function($) {
			$(window).scroll(function() {
				if(($(window).scrollTop() + $(window).height() > $(document).height() - 5) && loading) {
					loading = false;
					$("#pageNo").val(parseInt($("#pageNo").val()) + 1);
					query("00");
				}
			});
		})

		var ua = navigator.userAgent.toLowerCase();
		if(/android/.test(ua)) {
			$('.date>div>img:last').css({
				"margin-left": "-25px"
			});
			alert("123")
		}
	</script>
</html>